﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Serialization;

namespace RattlerRace
{
    [Serializable]
    [XmlRoot("GameStatsList")]
    public class GameStatsList {

        [XmlArray("Results"), XmlArrayItem(typeof(GameStats), ElementName = "GameStats")]
        List<GameStats> results;
        public List<GameStats> Results
        {
            get { return results; }
            set { results = value; }
        }

        public GameStatsList() {
            results = new List<GameStats>();
        }
    }

    [Serializable]
    public class GameStats
    {
        private int life;
        public int Life
        {
            get { return life; }
            set { life = value; }
        }

        private int score;
        public int Score
        {
            get { return score; }
            set { score = value; }
        }

        private int curLevel;
        public int CurLevel
        {
            get { return curLevel; }
            set { curLevel = value; }
        }

        private GameOptions gameOptions;
        public GameOptions GameOptions
        {
            get { return gameOptions; }
            set { gameOptions = value; }
        }

        private string playerName;
        public string PlayerName
        {
            get { return playerName; }
            set { playerName = value; }
        }

        public GameStats()
            : this(3, 0, 1)
        {
        }

        public GameStats(int life, int score, int curLevel) {
            this.life = life;
            this.score = score;
            this.curLevel = curLevel;
        }

    }
}
